import Vue from 'vue'
import VueRouter from 'vue-router'
import home from "@/views/home"

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login',
  },
  {
    path: '/login',
    component: () => import('../views/login.vue'),//登录
  },
  {
    path: '/home',
    name: 'home',
    component: home,
    redirect: '/home/order',
    children: [
      {//订单管理
        path: '/home/order',
        name: 'order',
        component: () => import('../views/order/order.vue')
      },
      {//添加订单
        path: '/addOrder',
        name: 'addOrder',
        component: () => import('../views/order/addOrder.vue')
      },
      {//订单提交成功
        path: '/submit',
        name: 'submit',
        component: () => import('../views/order/submit.vue')
      },
      {
        path: '/edit',
        name: 'edit',
        component: () => import('../views/order/edit.vue')
      },
      {//商品管理
        path: 'shopcontrol',
        name: 'shop_control',
        component: () => import(/* webpackChunkName: "about" */ '../views/shop_control/index.vue')
      },
      {//商品管理，查看商品
        path: '/shopInfo',
        name: '/shop_Info',
        component: () => import(/* webpackChunkName: "about" */ '../views/shop_control/shop_Info.vue')
      },

      {//添加商品
        path: '/add_shop',
        name: '/add_shop',
        component: () => import(/* webpackChunkName: "about" */ '../views/shop_control/add_shop.vue')
      },
      {
        path: "privilege",
        component: () => import('../views/privilege.vue')//权限管理
      },
      {
        path: "department",
        component: () => import('../views/DepartmentView.vue')//部门管理
      },
      {
        path: "log",
        component: () => import('../views/log.vue')//操作日志
      },
      // 客服管理
      {
        path: 'service',
        component: () => import('../views/service.vue')
      },
      // 账号管理
      {
        path: 'account',
        name: 'account',
        component: () => import('../views/account/account.vue')
      },
      // 添加成员
      {
        path: 'addMembers',
        name: 'addMembers',
        component: () => import('../views/addMembers/addMembers.vue')
      },
      // 角色管理
      {
        path: 'jueSeGuanLi',
        name: 'jueSeGuanLi',
        component: () => import('../views/jueSeGuanLi/jueSeGuanLi.vue')
      },

      {//会员列表
        path: 'members_list',
        name: 'members_list',
        component: () =>
          import(
      /* webpackChunkName: "about" */ '../views/members_list/MembersListView.vue'
          ),
      },
      {//会员列表-查看
        path: '/members_details',
        name: 'members_details',
        component: () => import('@/views/members_details/members_detailsView.vue'),
      },
      {//首页栏目管理
        path: 'hcm',
        name: 'HCM',
        component: () => import('../views/HomeColumnManagement/HCM.vue'),
      },
      {//首页栏目管理/编辑内容
        path: '/hcm/banner',
        name: 'HCMbanner',
        component: () => import('../views/HomeColumnManagement/HCMbanner.vue'),
      },
      {//热销榜
        path: 'hotsell',
        name: 'hotsell',
        component: () => import('../views/hotsell/index.vue')
      },
      {//搜索词
        path: 'searchWord',
        name: 'searchWord',
        component: () => import('../views/searchWord/index.vue')
      },
      {//服务说明
        path: '/home/service',
        name: 'service',
        component: () => import('../views/Service_description/index.vue')
      },
    ],
  },

]

const router = new VueRouter({
  routes
})

export default router
